async function loadConfig() {
    try {
        const response = await fetch(chrome.runtime.getURL('config.json'));
        const config = await response.json();
        console.log('config',config);
        return config;
    } catch (error) {
        console.error('加载配置文件失败:', error);
        return null;
    }
}

chrome.runtime.onInstalled.addListener(async () => {
    const config = await loadConfig();
    if (config) {
        // 将配置存储到 Chrome 存储中
        chrome.storage.local.set({ config });
    }
});
